package com.controller.user;

import com.dto.QueryDto;
import com.pojo.ShangJia;
import com.service.ShangJiaService;
import com.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/userShangJia")
@Api(tags = "用户商家相关接口")
public class ShangJiaController {
    @Autowired
    private ShangJiaService shangJiaService;
    @PostMapping("/query")
    @ApiOperation("搜索周边商户")
    public Result<List<ShangJia>> queryShangJia(@RequestBody QueryDto queryDto){
        List<ShangJia> list=shangJiaService.userquerynearby(queryDto);
        return Result.success(list);
    }
}
